﻿<UserControl x:Class="EPE.WPF.UCLogList"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="700" d:DesignWidth="1024">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"></RowDefinition>
        </Grid.RowDefinitions>

        <Border Grid.Row="0" Height="500" Width="850" Style="{StaticResource MainBorderStyle}">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="140"></RowDefinition>
                    <RowDefinition Height="15"></RowDefinition>
                    <RowDefinition Height="*"></RowDefinition>
                </Grid.RowDefinitions>
                <GroupBox Grid.RowSpan="2" Header="查询条件" Height="130" Width="830" HorizontalAlignment="Center"  Margin="5,10,5,0" Name="groupBox1" VerticalAlignment="Top" Grid.Row="0" Grid.Column="0">
                    <Grid Style="{StaticResource BorderGridStyle}">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="80"></ColumnDefinition>
                            <ColumnDefinition Width="120"></ColumnDefinition>
                            <ColumnDefinition Width="80"></ColumnDefinition>
                            <ColumnDefinition Width="120"></ColumnDefinition>
                            <ColumnDefinition Width="400"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="30"></RowDefinition>
                            <RowDefinition Height="30"></RowDefinition>
                            <RowDefinition Height="30"></RowDefinition>
                            <RowDefinition Height="10"></RowDefinition>
                            <RowDefinition Height="*"></RowDefinition>
                        </Grid.RowDefinitions>
                        <Label Content="用户"  Name="lblKeyword"  Grid.Row="0" Grid.Column="0"   VerticalAlignment="Center" Style="{StaticResource LabelStyle}" />
                        <TextBox Name="txtKeyword" Grid.Row="0" Grid.Column="1"  Grid.ColumnSpan="3" VerticalAlignment="Center" Style="{StaticResource TextBox320}" />
                        <Label Content="开始日期"  Name="lblDateStart"  Grid.Row="1" Grid.Column="0"   VerticalAlignment="Center" Style="{StaticResource LabelStyle}" />
                        <DatePicker Name="txtDateStart" Grid.Row="1" Grid.Column="1"  VerticalAlignment="Center" Style="{StaticResource DatePickerStyle}"></DatePicker>
                        <Label Content="结束日期"  Name="lblDateEnd"  Grid.Row="1" Grid.Column="2"   VerticalAlignment="Center" Style="{StaticResource LabelStyle}" />
                        <DatePicker Name="txtDateEnd" Grid.Row="1" Grid.Column="3"  VerticalAlignment="Center" Style="{StaticResource DatePickerStyle}"></DatePicker>

                        <StackPanel  Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="5" Orientation="Horizontal" >
                            <Button  Name="btnSearch" Click="btnSearch_Click" Style="{StaticResource ButtonStyle}">
                                <StackPanel Orientation="Horizontal" >
                                    <Image Source="/resources/image/close04.png" Stretch="Fill" Style="{StaticResource ButtonImageStyle}"></Image>
                                    <Label Content="查询" HorizontalAlignment="Center" Style="{StaticResource ButtonLabelStyle}"></Label>
                                </StackPanel>
                            </Button>



                        </StackPanel>


                    </Grid>
                </GroupBox>
                <GroupBox Header="日志信息" Height="320" Grid.Row="2" Grid.Column="0" HorizontalAlignment="Center"  Margin="5,0,5,0" Name="groupBox2" VerticalAlignment="Top" Width="830">
                    <DataGrid Style="{StaticResource DataGridStyle}" Grid.Row="4"  Grid.Column="0" Grid.ColumnSpan="5" Margin="5,10" Height="280" Width="770" Name="dgLog" HorizontalAlignment="Left"  VerticalAlignment="Top"  AutoGenerateColumns="False" ItemsSource="{Binding}"  SelectionMode="Single" IsReadOnly="True">
                        <DataGrid.Columns>
                            <DataGridTextColumn Visibility="Hidden" Binding="{Binding Id}"></DataGridTextColumn>
                            <DataGridTextColumn Header="时间" Width="100" Binding="{Binding Date , StringFormat='yyyy-MM-dd mm:ss'}" ></DataGridTextColumn>
                            <DataGridTextColumn Header="用户" Width="100" Binding="{Binding UserName}" ></DataGridTextColumn>
                            <DataGridTextColumn Header="操作内容" Width="100" Binding="{Binding Operation}"></DataGridTextColumn>
                            <DataGridTextColumn Header="备注" Width="100" Binding="{Binding Remark}" ></DataGridTextColumn>


                        </DataGrid.Columns>

                    </DataGrid>
                </GroupBox>

            </Grid>

        </Border>
    </Grid>
</UserControl>
